home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Java Primer Plus
/
Java Primer Plus (Waite Group Proess)(1996).iso
/
chapter15
/
Urlfun.java
< prev
Wrap
Text File
|
1995-12-31
|
511b
|
26 lines
import java.net.URL;
import java.net.URLConnection;
import java.net.MalformedURLException;
import java.io.InputStream;
import java.io.IOException;
public class Urlfun {
public static void main(String args[]) throws IOException,
MalformedURLException {
int g;
URL myURL = new URL("http://www.cat.syr.edu/~ptyma");
URLConnection myConn = myURL.openConnection();
InputStream datain = myConn.getInputStream();
while ((g = datain.read()) != -1)
System.out.write(g);
}
}